﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Milan
{
	public class SettingsValue
	{
		public SettingsValue(string name, Settings settings)
		{
			this.name = name;
			this.settings = settings;
		}
		public SettingsValue(string name)
		{
			this.name = name;
			settings = Settings.ProductUser;
		}
		public static implicit operator string(SettingsValue rhs)
		{
			return rhs.settings[rhs.name];
		}
		public string Get(string defaultValue = null)
		{
			return settings.GetValue(name, defaultValue);
		}
		public void Set(string value)
		{
			settings[this.name] = value;
		}
		private string name;
		private Settings settings;
	}
}
